/*
Copyright (c) 2006 - 2008  Universitaet Osnabrueck, virtUOS
Authors: Markus Ketterl, Johannes Emden, Nils Schuhmacher, Andreas Rickling

This file is part of virtPresenter.

virtPresenter is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

virtPresenter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with virtPresenter.  If not, see <http://www.gnu.org/licenses/>.
*/

package virtPresenter.control
{
	import com.adobe.cairngorm.control.FrontController;	
	import virtPresenter.event.*;
	import virtPresenter.commands.*;	
	
	/**
	 * The Controller is part of the Cairngorm Framework and 
	 * and assigns every event to its handling command.
	 * 
	 * @see com.adobe.cairngorm.control.FrontController
	 */
	public class virtPresenterController extends FrontController
	{
		public function virtPresenterController()
		{
			super();
			addCommand(AdvanceEvent.EVENT_ADVANCE_IN_PRESENTATION,AdvanceInPresentation);
			addCommand(AdvancedScrubberResizeEvent.ADVANCED_SCRUBBER_RESIZE,DrawAdvancedScrubber);
			
			addCommand(CairngormErrorEvent.EVENT_ERROR,HandleError);
			addCommand(ChangeApplicationColorEvent.CHANGE_COLOR,ChangeApplicationColor);
			addCommand(ChangedLectureFolderEvent.EVENT_CHANGELECTUREURL,ChangedLectureFolderCommand);
			addCommand(ChangeViewEvent.EVENT_CHANGE_VIEW,ChangeViewCommand);
			
			addCommand(GoToSlideEvent.EVENT_GO_TO_SLIDE,GoToSlide);
			addCommand(GoToAnimationStepEvent.EVENT_GO_TO_ANIMATION_STEP,GoToAnimationStep);
			addCommand(GoToLectureEvent.GO_TO_LECTURE_EVENT, GoToLectureCommand);
			
			addCommand(InitializeApplicationEvent.EVENT_INITIALIZE_APPLICATION, InitializeApplicationCommand);
						
			addCommand(LoadLectureRecordingsXMLEvent.LOAD_LECTURES_BY_NAME,LoadLectureRecordingsXML);
			addCommand(LoadLogXMLEvent.EVENT_LOAD_LOG_XML,LoadLogXMLCommand);
			addCommand(LoadSearchXMLEvent.LOAD_SEARCH_XML_EVENT,LoadSearchXML);
			addCommand(LoadVideoXMLEvent.EVENT_CHANGEVIDEOURL,LoadVideoXMLCommand);
			addCommand(LoadMouseXMLEvent.EVENT_LOAD_MOUSE_XML,LoadMouseXMLCommand);
			
			addCommand(NextSlideEvent.EVENT_NEXT_SLIDE,GoToNextSlide);
			
			addCommand(PlayStopVideoPlayerEvent.EVENT_PLAYSTOP,PlayStopCommand);
			addCommand(PreviousSlideEvent.EVENT_PREVIOUS_SLIDE,GoToPreviousSlide);
			addCommand(PreviousAnimationStepEvent.EVENT_PREVIOUS_ANIMATION_STEP,GoToPreviousAnimationStep);
									
			addCommand(SearchEvent.SEARCH_EVENT, SearchCommand);
			
			addCommand(ThumbnailSelectedEvent.EVENT_THUMBNAIL_SELECTED,ChangeThumbnailIndex);
			
			addCommand(VideoPlayerTimeChangeEvent.VIDEO_PLAYERL_TIME_CHANGE,VideoPlayerChange);
			addCommand(VideoPlayerResizeEvent.VIDEO_PLAYER_RESIZE,VideoPlayerResize);			
			
			addCommand(MainWindowPreviewEvent.EVENT_BIG_SLIDE_PREVIEW,MainWindowPreview);
			addCommand(MainWindowMiniPreviewEvent.EVENT_MAIN_WINDOW_MINI_PREVIEW,MainWindowMiniPreview);
			addCommand(SpeedareaScrollEvent.EVENT_SPEEDAREA_SCROLL,SpeedareaScroll);
		}
		
	}
}